home *** CD-ROM | disk | FTP | other *** search
- #include "includes.h"
-
- char *dgets(char *s, int size, FILE *stream)
- {
- int q;
- char thing;
- char *pointy;
-
- pointy=s;
-
- memset(s,0,size);
-
- for (q=0;q<size;++q)
- {
- thing=fgetc(stream);
- if ((thing==10) || (thing==13) || (thing==0))
- {
- fflush(stdout);
- return (char *)s;
- }
- if (thing==EOF)
- {
- return (char *)NULL;
- }
- memset(pointy+q,(int)thing,1);
- }
- return (char *)NULL;
- }
-
-